#!/bin/sh
#
# (C) 2009 Mika Ilmaranta <ilmis@nullnet.fi>
# (C) 2009 Tom Eastep <teastep@shorewall.net>
#
# License: GPLv2
#

STATE=${1}
DEVICE=${4}

if [ -f /usr/share/shorewall-lite/lib.base ]; then
	VARDIR=/etc/shorewall-lite/state
	STATEDIR=/etc/shorewall-lite
fi

[ -f ${STATEDIR}/vardir ] && . ${STATEDIR}/vardir

if [ ${STATE} = up ]; then
	${VARDIR}/firewall enable ${DEVICE}
else
	${VARDIR}/firewall disable ${DEVICE}
fi

/sbin/shorewall-lite show routing > /var/log/lsm

exit 0
